import request from '@/utils/request'
const baseURL = process.env.VUE_APP_BASE_URL
export function getTenantList() {
  return request({
    url: baseURL + '/superlink/api/tenants',
    method: 'get'
  })
}
export function getTenantConfigCommand(data) {
  return request({
    url: baseURL + `/superlink/api/instance/microservice/${data.activeName}/tenants/${data.token}/configuration`,
    method: 'get'
  })
}
export function postTenantConfigCommand(data, configToken, activeName) {
  return request({
    url: baseURL + `/superlink/api/instance/microservice/${activeName}/tenants/${configToken}/configuration`,
    method: 'post',
    data
  })
}

export function getTenant(tenantToken, method = 'get') {
  return request({
    url: baseURL + '/superlink/api/tenants/' + tenantToken,
    method
  })
}
export function postTenant(data) {
  return request({
    url: baseURL + '/superlink/api/tenants',
    method: 'post',
    data
  })
}
export function putTenant(data, token) {
  return request({
    url: baseURL + '/superlink/api/tenants/' + token,
    method: 'put',
    data
  })
}
